/*
 * @Author: jianfanfan 是是是
 * @Date: 2025-09-12 10:56:17
 * @LastEditors: jianfanfan 是是是
 * @LastEditTime: 2025-09-12 11:39:02
 * @FilePath: \nest-project\src\zzz\zzz.controller.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import {
  Controller,
  Get,
  Post,
  Body,
  Patch,
  Param,
  Delete,
  Version,
  VERSION_NEUTRAL,
} from '@nestjs/common';
import { ZzzService } from './zzz.service';
import { CreateZzzDto } from './dto/create-zzz.dto';
import { UpdateZzzDto } from './dto/update-zzz.dto';

@Controller({ path: 'zzz', version: ['1', '2'] })
export class ZzzController {
  constructor(private readonly zzzService: ZzzService) {}

  @Post()
  create(@Body() createZzzDto: CreateZzzDto) {
    return this.zzzService.create(createZzzDto);
  }

  @Version('2')
  @Get()
  findAllV2() {
    return this.zzzService.findAll() + '222';
  }

  @Get()
  findAll() {
    return this.zzzService.findAll();
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.zzzService.findOne(+id);
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateZzzDto: UpdateZzzDto) {
    return this.zzzService.update(+id, updateZzzDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.zzzService.remove(+id);
  }
}
